<?php
session_start();
?>
<html>
    <head>
        <meta http-equiv="refresh" content="100000;" /> 
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="style.css"/>
    </head>
    <body>
        <?php
        include('functions.php');
        include('header.php');
        $transfer = false;
        if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['resum']) && !empty($_POST['resum']) && isset($_POST['textimg']) && !empty($_POST['textimg']) && isset($_POST['textart']) && !empty($_POST['textart']) && isAdmin() && coUser()) {
            $transfer = true;
        } else {
            echo 'Tous les champs sont obligatoires';
        }
        
        if ($transfer) {
                if (isset($_POST['cbune']))
                    $cbune = true; 
                else
                    $cbune = false;
                editArticle($_POST['idarticle'], $_POST['title'], $cbune, $_POST['textimg'], $_POST['resum'], $_POST['cat'], $_POST['textart']);
        }
        ?>
    </body>
</html>
